﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Skyworth.CRM.Web.Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=7" />
    <title>销售管理平台</title>
    <link href="themes/default/style.css" rel="stylesheet" type="text/css" />
    <link href="themes/css/core.css" rel="stylesheet" type="text/css" />
    <link href="themes/css/wbox.css" rel="stylesheet" type="text/css" />
    <!--[if IE]>
     <link href="themes/css/ieHack.css" rel="stylesheet" type="text/css" />
    <![endif]-->
    <link rel="stylesheet" href="themes/css/jquery.cluetip.css" type="text/css" />
    <%--<script src="javascripts/speedup.js" type="text/javascript"></script>--%>

    <script src="javascripts/jquery-1.4.4.min.js" type="text/javascript"></script>
    <script src="javascripts/jquery.cookie.js" type="text/javascript"></script>
    <script src="javascripts/jquery.validate.js" type="text/javascript"></script>
    <script src="javascripts/jquery.bgiframe.js" type="text/javascript"></script>
    <script src="javascripts/dwz.core.js" type="text/javascript"></script>
    <script src="javascripts/dwz.accordion.js" type="text/javascript"></script>
    <script src="javascripts/dwz.contextmenu.js" type="text/javascript"></script>
    <script src="javascripts/dwz.navTab.js" type="text/javascript"></script>
    <script src="javascripts/dwz.tree.js" type="text/javascript"></script>
    <script src="javascripts/jquery.cluetip.min.js" type="text/javascript"></script>

    <%--<script src="javascripts/dwz.resize.js" type="text/javascript"></script>
<script src="javascripts/dwz.panel.js" type="text/javascript"></script>
<script src="javascripts/dwz.alertMsg.js" type="text/javascript"></script>--%>
    <script src="javascripts/dwz.drag.js" type="text/javascript"></script>
    <script src="javascripts/dwz.theme.js" type="text/javascript"></script>
    <script src="javascripts/dwz.barDrag.js" type="text/javascript"></script>
    <script src="javascripts/dwz.ui.js" type="text/javascript"></script>
    <script src="javascripts/wbox.js" type="text/javascript"></script>

    <%--<script src="javascripts/dwz.ajax.js" type="text/javascript"></script>
<script src="javascripts/dwz.stable.js" type="text/javascript"></script>
<script src="javascripts/dwz.cssTable.js" type="text/javascript"></script>
<script src="javascripts/dwz.pagination.js" type="text/javascript"></script>--%>
    <%--<script src="javascripts/dwz.switchEnv.js" type="text/javascript"></script>
<script src="javascripts/dwz.util.date.js" type="text/javascript"></script>
<script src="javascripts/dwz.validate.method.js" type="text/javascript"></script>
<script src="javascripts/dwz.regional.zh.js" type="text/javascript"></script>
<script src="javascripts/dwz.tab.js" type="text/javascript"></script>

<script src="javascripts/dwz.jDialog.js" type="text/javascript"></script>
<script src="javascripts/dwz.dialogDrag.js" type="text/javascript"></script>
<script src="javascripts/dwz.taskBar.js" type="text/javascript"></script>
<script src="javascripts/dwz.database.js" type="text/javascript"></script>
<script src="javascripts/dwz.datepicker.js" type="text/javascript"></script>
<script src="javascripts/dwz.effects.js" type="text/javascript"></script>
<script src="javascripts/dwz.checkbox.js" type="text/javascript"></script>
<script src="javascripts/dwz.history.js" type="text/javascript"></script>
<script src="javascripts/dwz.combox.js" type="text/javascript"></script>--%>
    <style type="text/css">
    .refresh
    {
    	display: block;
    height: 21px;
    overflow: hidden;
    position: absolute;
    text-indent: -1000px;
    width: 20px;
    right: 10px;
    top: 15px;
     background: url("themes/default/images/button/imgX.gif") no-repeat scroll 0 0 transparent;
     background-position: -161px 0;
     cursor:pointer;
    }
    </style>
    <script type="text/javascript">
        var empId=<%=empId %>;
        var userId=<%=UserID %>;
        var addWindow;
        
        function LoadMyToDoOrders()
        {
          $.ajax({
                type: "POST",
                url: "Default.aspx/GetMyToDoOrders",
                contentType: "application/json; charset=utf-8",
                data: '{"empId":"'+empId+'"}',
                dataType: "json",
                success: function(data) {
                    var dataTable = jQuery.parseJSON(data.d);
                    //填充数据
                    $("#ordersTable tbody").empty();
                    var lists = "";
                    $.each(dataTable, function(i, item) {
                        var orderDate =eval("new "+item.FUpdateDate.replace(/\//g,""));
                        lists = lists + "<tr rel='" + item.Fitemid + "' status='"+item.Fstatus+"'>" +
                        "<td><a href='javascript:void(0)' rel='Orders/OrderDetails.aspx?orderId="+item.Fitemid+"'>" + item.Fnumber + "</a></td>" +
                        "<td><a href='javascript:void(0)' rel='Orders/OrderProcess.aspx?orderId="+item.Fitemid+"'>" + item.Ftitle + "</a></td>" +
                        "<td>" + item.ContactName + "</td>" +
                        "<td>" + item.FDreeName + "</td>" +
                        "<td>" + item.stockName + "</td>" +
                        "<td>" + item.Fqty + "</td>" +
                        "<td>" + item.Fvolume + "</td>" +
                        "<td>" + item.Fprice + "</td>" +
                        "<td>" + item.FtaxPrice + "</td>" +
                        "<td>" + orderDate.getFullYear() + "-" + (orderDate.getMonth() + 1) + "-" + orderDate.getDate() + "</td>" +
                        "<td>" + item.StatusName + "</td>" +
                        "<td><a href='Javascript:void(0)'>审核</a></td>" +
                        "</tr>";
                    })
                    $(lists).appendTo($("#ordersTable tbody"));

                    //绑定事件
                    $("#ordersTable tr:nth-child(even)").attr('class', "trbg");
                    $("#ordersTable tbody tr").click(function() {
                        $(this).addClass("selected");
                        $(this).siblings("tr").removeClass("selected");
                    }).hover(function() {
                        $(this).addClass('hover');
                    }, function() {
                        $(this).removeClass('hover');
                    })                    
                    $("#ordersTable tbody tr").each(function(){                       
                        $(this).find("td").eq(0).find("a").cluetip({ cluetipClass: 'jtip', width: '810px', sticky: true, activation: 'click', closePosition: 'title', arrows: true, closeText: '<img src="themes/images/cancel.png" alt="【关闭】" />' })
                        $(this).find("td").eq(1).find("a").cluetip({ cluetipClass: 'jtip', width: '465px', sticky: true, activation: 'click', closePosition: 'title', arrows: true, closeText: '<img src="themes/images/cancel.png" alt="【关闭】" />', ajaxCache:false });
                        PopUpHandlePage(this);
                    });
                },
                error: function(msg) { $.Messager.Alert({ Title: '系统消息', Message: "发生异常，获取订单数据失败！", Icon: IconType.Warning }); },
                beforeSend: function(){$("#LoadingPanel").fadeIn("slow");},
                complete: function(){$("#LoadingPanel").fadeOut("fast");}
            })
        }
        
        function PopUpHandlePage(JTrObj)
        {
            var orderId =  $(JTrObj).attr("rel");
            var orderCode = $(JTrObj).find("td").eq(0).text();           
            addWindow = $(JTrObj).find("td:last-child").find("a").wBox({ title: "审核订单【" + orderCode + "】", requestType: "iframe", target: "Orders/OrdersAuditing.aspx?orderId=" + orderId, iframeWH: { width: 800, height: 420} });
        }
        
        $(document).ready(function() {
            //debugger;
            DWZ.init("dwz.frag.xml", {
                loginUrl: "login.aspx", // 跳到登录页面
                debug: false, // 调试模式 【true|false】
                callback: function() {
                    initEnv();
                    $("#themeList").theme({ themeBase: "themes" });
                }
            });

            addWindow = $("#changPassword").wBox({ title: "修改当前密码", requestType: "iframe", target: "SystemManagement/changePassword.aspx?userId="+userId, iframeWH: { width: 300, height: 180} });
            LoadMyToDoOrders();
        
        });
    </script>

</head>
<body scorll="no">
    <div id="layout">
        <div id="header">
            <div class="headerNav">
                <a class="logo" href="javascript:void(0)">标志</a>
                <ul class="nav">
                    <li><a href="javascript:void(0)">当前登陆用户：<label id="lblUserName" runat="server"></label></a></li>
                    <li><a href="javascript:void(0)" id="changPassword">修改密码</a></li>
                    <li><a href="login.aspx">退出</a></li>
                </ul>
                <ul class="themeList" id="themeList">
                    <li theme="default">
                        <div class="selected">
                            蓝色</div>
                    </li>
                    <li theme="green">
                        <div>
                            绿色</div>
                    </li>
                    <!--<li theme="red"><div>红色</div></li>-->
                    <li theme="purple">
                        <div>
                            紫色</div>
                    </li>
                    <li theme="silver">
                        <div>
                            银色</div>
                    </li>
                    <li theme="azure" class="azure">
                        <div class="">
                            天蓝</div>
                    </li>
                </ul>
            </div>
        </div>
        <div id="leftside">
            <div id="sidebar_s">
                <div class="collapse">
                    <div class="toggleCollapse">
                        <div>
                        </div>
                    </div>
                    <div class="collapseTitle">
                        系统功能菜单</div>
                </div>
            </div>
            <div id="sidebar">
                <div class="toggleCollapse">
                    <h2>
                        系统功能菜单</h2>
                    <div>
                        收缩</div>
                </div>
                <div class="accordion" fillspace="sidebar">
                    <asp:Literal ID="MenuTree" runat="server"></asp:Literal>
                </div>
            </div>
        </div>
        <div id="container">
            <div id="navTab" class="tabsPage">
                <div class="tabsPageHeader">
                    <div class="tabsPageHeaderContent">
                        <!-- 显示左右控制时添加 class="tabsPageHeaderMargin" -->
                        <ul class="navTab-tab">
                            <li tabid="main" class="main"><a href="javascript:void(0)"><span><span class="home_icon">
                                我的主页</span></span></a></li>
                        </ul>
                    </div>
                    <div class="tabsLeft">
                        left</div>
                    <!-- 禁用只需要添加一个样式 class="tabsLeft tabsLeftDisabled" -->
                    <div class="tabsRight">
                        right</div>
                    <!-- 禁用只需要添加一个样式 class="tabsRight tabsRightDisabled" -->
                    <div class="tabsMore">
                        more</div>
                </div>
                <ul class="tabsMoreList">
                    <li><a href="javascript:void(0)">我的主页</a></li>
                </ul>
                <div class="navTab-panel tabsPageContent">
                    <div>
                        <div class="pageFormContent" layouth="0">
                            <div class="panel">
                                <div class="panelHeader">
                                    <div class="panelHeaderContent">
                                        <h1>
                                            待处理的订单</h1>
                                         <a href="javascript:LoadMyToDoOrders()" class="refresh" title="刷新" >刷新</a>
                                    </div>
                                </div>
                                <div class="panelContent">
                                    <div class="tableList">
                                        <table class="list" width="100%" id="ordersTable">
                                            <thead>
                                                <tr>
                                                    <th width="100" valign="middle" style="cursor: pointer;" colname="T_Order.Fnumber">
                                                        <span style="float: left">订单编号</span> <span style="float: right;" class="sortIcon">
                                                        </span>
                                                    </th>
                                                    <th valign="middle" style="cursor: pointer;" colname="Ftitle">
                                                        <span style="float: left">订单名称</span> <span style="float: right;" class="sortIcon">
                                                        </span>
                                                    </th>
                                                    <th valign="middle" style="cursor: pointer;" colname="FcontactID">
                                                        <span style="float: left">联系人</span> <span style="float: right;" class="sortIcon">
                                                        </span>
                                                    </th>
                                                    <th valign="middle" style="cursor: pointer;" colname="FCusDreeID">
                                                        <span style="float: left">收货地址</span> <span style="float: right;" class="sortIcon">
                                                        </span>
                                                    </th>
                                                    <th valign="middle" style="cursor: pointer;" colname="FstockID">
                                                        <span style="float: left">收货仓库</span> <span style="float: right;" class="sortIcon">
                                                        </span>
                                                    </th>
                                                    <th valign="middle" style="cursor: pointer;" colname="Fqty">
                                                        <span style="float: left">总数量</span> <span style="float: right;" class="sortIcon">
                                                        </span>
                                                    </th>
                                                    <th valign="middle" style="cursor: pointer;" colname="Fvolume">
                                                        <span style="float: left">总体积</span> <span style="float: right;" class="sortIcon">
                                                        </span>
                                                    </th>
                                                    <th valign="middle" style="cursor: pointer;" colname="Fprice">
                                                        <span style="float: left">不含税金额</span> <span style="float: right;" class="sortIcon">
                                                        </span>
                                                    </th>
                                                    <th valign="middle" style="cursor: pointer;" colname="FtaxPrice">
                                                        <span style="float: left">含税金额</span> <span style="float: right;" class="sortIcon">
                                                        </span>
                                                    </th>
                                                    <th valign="middle" style="cursor: pointer;" colname="FUpdateDate" class="headerSortDown">
                                                        <span style="float: left">下单日期</span> <span style="float: right;" class="sortIcon">
                                                        </span>
                                                    </th>
                                                    <th width="100" valign="middle" style="cursor: pointer;">
                                                        <span>订单状态</span>
                                                    </th>
                                                    <th width="40" valign="middle" style="cursor: pointer;">
                                                        <span>审核</span>
                                                    </th>
                                                </tr>
                                            </thead>
                                            <tbody>
                                            </tbody>
                                            <tfoot>
                                            </tfoot>
                                        </table>
                                    </div>
                                </div>
                                <div class="panelFooter">
                                    <div class="panelFooterContent">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <%--<div id="taskbar" style="left: 0px; display: none;">
            <div class="taskbarContent">
                <ul>
                </ul>
            </div>
            <div class="taskbarLeft taskbarLeftDisabled" style="display: none;">
                taskbarLeft</div>
            <div class="taskbarRight" style="display: none;">
                taskbarRight</div>
        </div>--%>
        <div id="splitBar">
        </div>
        <div id="splitBarProxy">
        </div>
    </div>
    <div id="footer">
        <div id="leftText">
            <span>DESIGNED BY JIAZHITENG</span></div>
        <div id="rightText">
            <span>POWERED BY Skyworth &copy; 2000-2011,All Rights Reserved</span></div>
    </div>
    <!--拖动效果-->
    <%--<%-- <div class="resizable">
        </div>
        <!--阴影-->
        <div class="shadow" style="width: 508px; top: 148px; left: 296px;">
            <div class="shadow_h">
                <div class="shadow_h_l">
                </div>
                <div class="shadow_h_r">
                </div>
                <div class="shadow_h_c">
                </div>
            </div>
            <div class="shadow_c">
                <div class="shadow_c_l" style="height: 296px;">
                </div>
                <div class="shadow_c_r" style="height: 296px;">
                </div>
                <div class="shadow_c_c" style="height: 296px;">
                </div>
            </div>
            <div class="shadow_f">
                <div class="shadow_f_l">
                </div>
                <div class="shadow_f_r">
                </div>
                <div class="shadow_f_c">
                </div>
            </div>
        </div>
        <!--遮盖屏幕-->
        <div id="alertBackground" class="alertBackground">
        </div>
        <div id="dialogBackground" class="dialogBackground">
        </div>--%>
    <div id="LoadingPanel" style="display: none;">
        <div id='background' class='background'>
        </div>
        <div id='progressBar' class='progressBar'>
            数据加载中，请稍等...</div>
    </div>
</body>
</html>
